package xeploai;

import java.util.Scanner;

public class HocSinh {
//attributes:
	private String maSo;
	private String hoTen;
	private String birthday;
	private double diemToan;
	private double diemVan;
	private double diemNgoaiNgu;
	private double diemTrungBinh;

//methods:
	//nhap thong tin cu hoc sinh
	public void nhapThongTin() {
		Scanner s = new Scanner(System.in);
		
		System.out.print("Ma so: ");
		maSo = s.nextLine();
		
		System.out.print("Ho ten: ");
		hoTen = s.nextLine();
		
		System.out.print("Ngay, thang, nam sinh: ");
		birthday = s.nextLine();
		
		System.out.print("Diem mon Toan: ");
		diemToan = kiemTraDiem();
		
		System.out.print("Diem mon Van: ");
		diemVan = kiemTraDiem();
		
		System.out.print("Diem Ngoai Ngu: ");
		diemNgoaiNgu = kiemTraDiem();
	}
	
	//tinh diem trung binh
	public double diemTrungBinh() {
		diemTrungBinh = ((diemToan * 2) + (diemVan * 2) + diemNgoaiNgu)/5;
		
		return diemTrungBinh;
	}
	
	//xep loai hoc luc
	public void xepLoai() {
		if(diemToan == 0 || diemVan == 0 || diemNgoaiNgu == 0) {
			System.out.print("Yeu");
		}
		else {
			if(diemTrungBinh < 5) {
				System.out.print("Yeu");
			}
			else if(diemTrungBinh < 7) {
				System.out.print("Trung Binh");
			}
			else if(diemTrungBinh < 8) {
				System.out.print("Kha");
			}
			else {
				System.out.print("Gioi");
			}
		}
	}
	
	//kiem tra diem nhap vao
	public double kiemTraDiem() {
		double diem;
		Scanner s = new Scanner(System.in);
		diem = s.nextDouble();
		while(diem < 0 || diem > 10) {
			diem = s.nextDouble();
		}
		
		return diem;
	}
	
	//kiem tra ma so
	public void kiemTraMaSo(String ms) {
		
	}
	
	public String getMaSo() {
		return maSo;
	}
	public void setMaSo(String maSo) {
		this.maSo = maSo;
	}
	public String getHoTen() {
		return hoTen;
	}
	public void setHoTen(String hoTen) {
		this.hoTen = hoTen;
	}
	public String getBirthday() {
		return birthday;
	}
	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}
	public double getDiemToan() {
		return diemToan;
	}
	public void setDiemToan(double diemToan) {
		this.diemToan = diemToan;
	}
	public double getDiemVan() {
		return diemVan;
	}
	public void setDiemVan(double diemVan) {
		this.diemVan = diemVan;
	}
	public double getDiemNgoaiNgu() {
		return diemNgoaiNgu;
	}
	public void setDiemNgoaiNgu(double diemNgoaiNgu) {
		this.diemNgoaiNgu = diemNgoaiNgu;
	}

	public double getDiemTrungBinh() {
		return diemTrungBinh;
	}

	public void setDiemTrungBinh(double diemTrungBinh) {
		this.diemTrungBinh = diemTrungBinh;
	}
}
